
/**
 * @see https://umijs.org/docs/max/access#access
 * */
// todo: 这里是权限管理
export default function access(initialState: { initialState: InitialState } | undefined) {

  const { loginUser } = initialState?? {};

  return {
    canUser: loginUser?.userRole === 'user',
    canAdmin: loginUser && loginUser?.userRole === 'admin',
    // canAdmin: loginUser?.userRole === 'admin',
  };
};
